package ddz;
import java.util.Scanner;
public class pdd3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        String t = sc.nextLine();
        if(!s.contains("#")){
            System.out.println(s);
            return;
        }
        char[] ch = s.toCharArray();
        int[] map1 = new int[26];
        for (char c : ch) {
            if (c != '#') {
                map1[c - 'a']++;
            }
        }
        char[] chT = t.toCharArray();
        for (char c : chT) {
            map1[c - 'a']--;
        }
        for (int i = 0; i < ch.length; i++) {
            if(ch[i] == '#'){
                for (int j = map1.length - 1; j >= 0; j--) {
                    if(map1[j] < 0){
                        ch[i] = (char) (j + 'a');
                        map1[j]--;
                    }
                }
            }
        }
        StringBuilder sb = new StringBuilder();
        for (char c : ch) {
            sb.append(c);
        }
        System.out.println(sb.toString());
    }
}
/*
#aa#
ab

abcd
abacaba
 */